package demo2;

import java.util.Arrays;

public class LeetCode183 {
    public void moveZeroes(int[] nums) {
        int left = -1, right = 0, n = nums.length;
        for(right = 0; right < n; right++) {
            if(nums[right] != 0) {
                left++;
                int tmp = nums[right];
                nums[right] = nums[left];
                nums[left] = tmp;
            }
        }
        System.out.println(Arrays.toString(nums));
    }
}
